package com.hbnu.list;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class TestPoker {
    public static void main(String[] args) {
        List<String> poker = new ArrayList<>();

        String[] color = new String[] {"♥","♣","♦","♠"};
        String[] number = new String[] {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};

        for (String c : color) {
            for (String n : number) {
                poker.add(c+n);
            }
        }

        poker.add("King");
        poker.add("Quene");

        Collections.shuffle(poker);

        //
        List<String> player1 = new ArrayList<>();
        List<String> player2 = new ArrayList<>();
        List<String> player3 = new ArrayList<>();
        List<String> bottom = new ArrayList<>();

        for (int i = 0;i < poker.size();i++){
            if (i < 3) {
                bottom.add(poker.get(i));
            }
            else {
                if (i%3 == 0) {
                    player1.add(poker.get(i));
                }
                else if (i%3 == 1) {
                    player2.add(poker.get(i));
                }
                else if (i%3 == 2) {
                    player3.add(poker.get(i));
                }
            }
        }

        LookLookPoker("玩家0",player1);
        LookLookPoker("玩家1",player2);
        LookLookPoker("玩家2",player3);
        LookLookPoker("底牌",bottom);
    }

    private static void LookLookPoker(String name,List<String> player) {
        System.out.println(name+"的牌是：");
        for (String p : player) {
            System.out.print(p + "\t");
        }
        System.out.println();
    }
}





